﻿<UserControl x:Class="SilveR.Views.StatsViews.RepeatedMeasures"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
             
    mc:Ignorable="d"
    d:DesignHeight="797" d:DesignWidth="825">
    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
        <Grid>
            <Border BorderBrush="Silver" Margin="3,3,3,3" Style="{StaticResource MainAnalysisBorderStyle}" >
                <Grid>
                    <TextBlock Text="Input" Margin="3,3,3,3" Style="{StaticResource TextBlockStyle}" />

                    <TextBlock Text="Select dataset" Margin="3,23,0,0"  Style="{StaticResource TextBlockStyle}" />
                    <ComboBox Name="cboData" Margin="95,19,0,0" ItemsSource="{Binding AvailableDataHandlers}" SelectedItem="{Binding SelectedDataHandler, Mode=TwoWay}" DisplayMemberPath="DisplayFileName" SelectionChanged="cboData_SelectionChanged" Style="{StaticResource ComboBoxStyle}"/>

                    <TextBlock Text="Available variables" Margin="3,49,0,0" Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Height="290" Margin="3,71,0,0" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}" >
                        <ListBox Name="lstAvailableVariables" DisplayMemberPath="ColumnName" ItemsSource="{Binding AvailableVariables, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>
                    <Border Margin="133,49,0,0" Style="{StaticResource MinorAnalysisBorderStyle}">
                        <Grid>
                            <TextBlock Text="Response" Margin="3,6,6,6" Style="{StaticResource TextBlockStyle}" />
                            <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="3,23,0,0" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                                <ListBox Name="lstResponse" DisplayMemberPath="ColumnName" ItemsSource="{Binding ResponseList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                            </toolkit:ListBoxDragDropTarget>

                            <TextBlock Text="Transformation" Margin="25,53,6,6" Style="{StaticResource TextBlockStyle}"/>
                            <ComboBox Name="cboResponseTransformations" Margin="127,50,6,6" ItemsSource="{Binding TransformationList}" SelectedItem="{Binding ResponseTransformation, Mode=TwoWay}" Style="{StaticResource ComboBoxStyle}" IsEnabled="False"/>

                        </Grid>
                    </Border>

                    <TextBlock Text="Treatments (factorial)" Margin="137,138,0,0" Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="137,155,0,0" Height="80" Style="{StaticResource ListBoxDragDropTargetStyle}" ItemDragCompleted="Target_ItemDragCompleted">
                        <ListBox Name="lstTreatments" DisplayMemberPath="ColumnName" ItemsSource="{Binding Treatments, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Interactions" Margin="267,138,0,0" Style="{StaticResource TextBlockStyle}" />
                    <ListBox Name="lstInteractions" Margin="267,155,0,0" Height="80" Width="120" ItemsSource="{Binding Interactions, Mode=OneWay}" Style="{StaticResource ListBoxStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" BorderBrush="DarkSlateBlue" BorderThickness="1"/>

                    <TextBlock Text="Repeated factor" Margin="137,240,0,0" Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="137,255,0,0" Style="{StaticResource ListBoxDragDropTargetStyle}" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted">
                        <ListBox Name="lstRepeatedFactor" DisplayMemberPath="ColumnName" ItemsSource="{Binding RepeatedFactorList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Subject factor" Margin="267,240,0,0" Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="267,255,0,0" Style="{StaticResource ListBoxDragDropTargetStyle}" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted">
                        <ListBox Name="lstSubjectFactor" DisplayMemberPath="ColumnName" ItemsSource="{Binding SubjectFactorList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Other design (blocks)" Margin="137,283,0,0" Style="{StaticResource TextBlockStyle}" />
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="137,301,0,0" Height="60" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstOtherDesignFactors" DisplayMemberPath="ColumnName" ItemsSource="{Binding OtherDesignFactors, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Covariance" Margin="3,363,0,0" Style="{StaticResource TextBlockStyle}" />
                    <ComboBox Name="cboCovariance" Margin="3,383,0,0" ItemsSource="{Binding CovarianceList}" SelectedItem="{Binding Covariance, Mode=TwoWay}" Style="{StaticResource ComboBoxStyle}"/>

                    <Border Margin="137,365,0,0" Style="{StaticResource MinorAnalysisBorderStyle}">
                        <Grid>
                            <TextBlock Text="Covariate" Margin="6,6,3,3" Style="{StaticResource TextBlockStyle}"/>
                            <toolkit:ListBoxDragDropTarget AllowDrop="True" Height="23" Margin="6,26,3,3" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                                <ListBox Name="lstCovariate" DisplayMemberPath="ColumnName" ItemsSource="{Binding CovariateList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                            </toolkit:ListBoxDragDropTarget>

                            <TextBlock Text="Primary factor" Margin="36,63,0,0" Style="{StaticResource TextBlockStyle}"/>
                            <ComboBox Name="cboPrimaryFactor" Margin="125,59,0,0" DisplayMemberPath="ColumnName" ItemsSource="{Binding Treatments}" SelectedItem="{Binding PrimaryFactor, Mode=TwoWay}" IsEnabled="False" Style="{StaticResource ComboBoxStyle}"/>

                            <TextBlock Text="Transformation" Margin="30,92,0,0" Style="{StaticResource TextBlockStyle}"/>
                            <ComboBox Name="cboCovariateTransformations" Margin="125,91,0,0" ItemsSource="{Binding TransformationList}" SelectedItem="{Binding CovariateTransformation, Mode=TwoWay}" IsEnabled="False" Style="{StaticResource ComboBoxStyle}"/>
                        </Grid>
                    </Border>
                </Grid>
            </Border>
            <Border BorderBrush="Silver" Margin="416,3,3,3" Style="{StaticResource MainAnalysisBorderStyle}" >
                <Grid>
                    <TextBlock Text="Analysis Results" Margin="6,3,3,3" Style="{StaticResource TextBlockStyle}"/>
                    <Border Margin="6,21,0,0" Style="{StaticResource MinorAnalysisBorderStyle}">
                        <Grid>
                            <TextBlock Text="Overall results" Margin="3,3,3,3" Style="{StaticResource TextBlockStyle}"/>
                            <CheckBox Name="cbxANOVASelected" Content="ANOVA Table" IsChecked="{Binding ANOVASelected, Mode=TwoWay}" Margin="8,23,3,3" Style="{StaticResource CheckBoxStyle}" />
                            <CheckBox Name="cbxPRPlotSelected" Content="Predicted vs. Residuals Plot" IsChecked="{Binding PRPlotSelected, Mode=TwoWay}" Margin="8,43,3,3" Style="{StaticResource CheckBoxStyle}" />
                            <CheckBox Name="cbxNormPlotSelected" Content="Normal Probability Plot" IsChecked="{Binding NormalPlotSelected, Mode=TwoWay}" Margin="8,63,3,3" Style="{StaticResource CheckBoxStyle}"/>
                            <TextBlock Text="Significance" Margin="18,118,3,3" Style="{StaticResource TextBlockStyle}"/>
                            <ComboBox Margin="98,115,3,3" Name="cboSignificance" ItemsSource="{Binding SignificanceList}" SelectedItem="{Binding Significance, Mode=OneWay}" Style="{StaticResource ComboBoxStyle}"/>
                            <CheckBox Content="Least square (predicted) means" IsChecked="{Binding LSMeansSelected, Mode=TwoWay}" Margin="8,86,0,0" Name="checkBox1" Style="{StaticResource CheckBoxStyle}" />
                        </Grid>
                    </Border>
                    <Border Margin="6,181,0,0" Style="{StaticResource MinorAnalysisBorderStyle}">
                        <Grid>
                            <TextBlock Text="Selected effect results" Margin="3,3,3,3" Style="{StaticResource TextBlockStyle}"/>
                            <TextBlock Text="Effect" Margin="8,23,3,3" Style="{StaticResource TextBlockStyle}"/>
                            <ComboBox Margin="48,20,3,3" Name="cboSelectedEffect"  HorizontalAlignment="Stretch" Width="Auto" ItemsSource="{Binding SelectedEffectList}" SelectedItem="{Binding SelectedEffect, Mode=TwoWay}" IsEnabled="False" SelectionChanged="cboSelectedEffect_SelectionChanged" Style="{StaticResource ComboBoxStyle}"/>
                            <TextBlock Text="Post Hoc tests:" Margin="8,77,3,3" Style="{StaticResource TextBlockStyle}"/>
                            <RadioButton Content="All comparisons within repeated factor levels" Margin="40,97,0,0" Name="rdoAllComparisonsWithin" IsChecked="{Binding AllComparisonsWithinSelected}" Style="{StaticResource RadioButtonStyle}"/>
                            <RadioButton Content="All pairwise comparisons" Margin="40,119,0,0" Name="rdoAllPairwise" IsChecked="{Binding AllPairwiseComparisons}" Style="{StaticResource RadioButtonStyle}"/>
                        </Grid>
                    </Border>
                </Grid>
            </Border>
        </Grid>
    </ScrollViewer>
</UserControl>